
export const state = () => ({
  // 用户id
  userId: '',
  // 用户名称
  username: '',
  // 用户头像
  // avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif?imageView2/1/w/80/h/80',
  avatar: '',
  // 登录状态（false：未登录 true：登录）
  status: false,
})

export const mutations = {
  setUserId(state, userId) {
    state.userId = userId
  },
  setUsername(state, username) {
    state.username = username
  },
  setAvatar(state, avatar) {
    state.avatar = avatar
  },
  setStatus (state, status) {
    state.status = status
  },
}

// export const actions = {
//   setUsername({ commit }, username) {
//     commit('SET_USERNAME', username)
//   },
//   setAvatar({ commit }, avatar) {
//     commit('SET_AVATAR', avatar)
//   },
//   setStatus({ commit }, status) {
//     commit('SET_STATUS', status)
//   },
//   setTimer({ commit }, timer) {
//     commit('SET_TIMER', timer)
//   },
// }
